package com.bowling.sample;

import org.javaspec.*;

import static org.javaspec.Before.*;
import static org.javaspec.EqualExpectation.*;
import static org.javaspec.Expect.*;

@Describe(Bowling.class)
class BowlingSpec {

	private Bowling bowling;
	
	@Before(EACH) void before() {
		bowling = new Bowling();
	}

	@It void shouldScoreZeroForGutterGame() {
		for(int i=0; i<20; i++) {
			bowling.hit(0);
		}
		expect(bowling.getScore(), toEqual(0));
	}

	It shouldScoreSomething() {
		bowling.hit(1);
		return new Expect(bowling.getScore(), toBeNotNull());
	}
	
	@After(EACH) void after() {
		bowling = null;
	}
}
